import java.util.Arrays;

public class t518 {
    public static void main(String[] args) {
        int conis[] = {2,5,7};
        int amount = 27;
        int count = 0;
        int dp[] = new int [amount+1];
        dp[0] = 0;
        for(int i = 1 ; i<dp.length;i++){
            dp[i] = Integer.MAX_VALUE;
            for(int j =0; j<conis.length;j++){
                if(i>=conis[j] && dp[i-conis[j]]!=Integer.MAX_VALUE){
                    dp[i] = Math.min(dp[i],dp[i-conis[j]]+1);
                }
            }
        }


    }

}
